<!DOCTYPE html>
<html>
<head>
    <title>契税打印</title>
<#include "../../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">

</head>
<body style="overflow-y: hidden;">
<div class="layui-fluid">
    <blockquote class="layui-elem-quote layui-bg-white">
        契税表格【姓名：<span class="jmdf-color-red">${(contract.name)!}</span>】【协议编号：<span
            class="jmdf-color-red">${(contract.contractCode)!}</span>】
    </blockquote>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-lg4 layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" id="deedTaxForm">
                        <input type="hidden" name="contractId" value="${(contract.id)!}"/>
                        <div class="layui-card">
                            <div class="layui-form-item">
                                <table class="layui-table">
                                    <tr>
                                        <th style="text-align: center;min-width: 100px">面积类型</th>
                                        <th style="text-align: center;min-width: 80px">面积</th>
                                        <th style="text-align: center;min-width: 100px">单价</th>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">产权调换</td>
                                        <td style="text-align: center">${(contract.propertyChangeArea)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="propertyChangeAreaPrice"
                                                                              value="${(contract.propertyChangeAreaPrice)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">可限量照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea1)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea1Price"
                                                                              value="${(contract.careBuyArea1Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">可限量增加照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea2)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea2Price"
                                                                              value="${(contract.careBuyArea2Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">低保户照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea3)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea3Price"
                                                                              value="${(contract.careBuyArea3Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">居住困难户照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea4)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea4Price"
                                                                              value="${(contract.careBuyArea4Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">未建合法宅基地照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea5)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea5Price"
                                                                              value="${(contract.careBuyArea5Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">房屋倒塌或只有房屋基础照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea6)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea6Price"
                                                                              value="${(contract.careBuyArea6Price)!}"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: center">企业照顾购买</td>
                                        <td style="text-align: center">${(contract.careBuyArea7)!}</td>
                                        <td style="text-align: center"><input type="text" style="width: 150px"
                                                                              class="layui-input"
                                                                              lay-verify="bigDecimal"
                                                                              name="careBuyArea7Price"
                                                                              value="${(contract.careBuyArea7Price)!}"/>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body">
                    <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="submit">保存</button>
                </div>
            </div>
        </div>
        <div class="layui-col-lg8 layui-col-md8">
            <div class="layui-card">
                <div class="layui-tab layui-tab-brief" id="deedTax">
                    <ul class="layui-tab-title">
                        <li source="/pdf/print/deedTaxPrint?contractId=${(contract.id)!}" class="layui-this">契税明细表</li>
                        <li source="/pdf/print/deedTaxFourPrint?contractId=${(contract.id)!}">契税四方会签表</li>
                        <li source="/pdf/print/deedTaxForTaxDepartmentPrint?contractId=${(contract.id)!}">税务部门</li>
                    </ul>
                    <iframe id="printIframe" style="width: 100%;height: 730px;margin-top: 10px"></iframe>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/bigDecimal/BigDecimal-all-last.js"></script>
<script src="/bigDecimal/BigDecimal-all-last.min.js"></script>
<script src="/bigDecimal/common.js"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['jquery', 'layer', 'element', 'jmdf', 'verify', 'form'], function () {
        var $ = layui.jquery, form = layui.form, jmdf = layui.jmdf, layer = layui.layer, verify = layui.verify, element = layui.element;

//        打印链接调用
        function openPdf(source) {
            var url = source + "#toolbar=0";
            $("#printIframe").attr("src", url);
        }

        $("#deedTax li").click(function () {
            var source = $(this).attr("source");
            openPdf(source);
        });
        openPdf($("#deedTax li").attr("source"));


        //保存面积单价
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: "setDeedTaxPrice",
                type: "post",
                data: $("#deedTaxForm").serialize(),
                success: function (data) {
                    if (data.code == "0001") {
                        layer.msg(data.message, {anim: 0, icon: 1, time: 500}, function () {
                            location.reload();
                        });
                    } else {//失败
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });
    });

</script>
</html>
